package me.yobol.datastructure.basic.list.linked.dll;

/**
 *
 * @author Yobol
 */
public class DoubleLinkedListTest {
    public static void main(String[] args) {
        DoubleLinkedList dll = new DoubleLinkedList();
        dll.init();
        try {
            DoubleLinkedNode n1 = new DoubleLinkedNode(1);
            dll.insert(n1);
            DoubleLinkedNode n2 = new DoubleLinkedNode(2);
            dll.insert(n2);
            DoubleLinkedNode n3 = new DoubleLinkedNode(3);
            dll.insert(n3);
            
            System.out.println("获得第三个位置上结点的key ： " + (dll.getByLocale(3)).getKey());
            System.out.println("删除的结点的key ： " + (dll.delete(2)).getKey());
            
            System.out.println("获得key=3所对应的结点 ： " + dll.getByKey(3).getKey());
            dll.print();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
